#ifndef GUTILS_H
#define GUTILS_H

#include <QWidget>
#include <QSqlQueryModel>
#include <QSqlTableModel>
#include <QModelIndex>
#include <QList>
#include <QListWidget>
#include <QSqlDatabase>
#include <QMessageBox>
#include <QInputDialog>
#include <QSqlQuery>


#include <moneydelegate.h>
#include <qmodeldatareport.h>
#include <tableviewdialog.h>


namespace Ui {
class GUtils;
}

class GUtils : public QWidget
{
    Q_OBJECT

public:
    explicit GUtils(QWidget *parent = 0);
    ~GUtils();

private slots:
    void on_listProProms_clicked(const QModelIndex &index);

    void on_buttonProAnnuler_clicked();

    void on_buttonProValider_clicked();

    void on_buttonProNouveau_clicked();

    void on_buttonProSupprimer_clicked();

    void on_tableUtilisateurs_clicked(const QModelIndex &index);

    void on_buttonDetailAnnuler_clicked();

    void on_buttonUtilisateurNouveau_clicked();

    void on_buttonDetailValider_clicked();

    void on_buttonFiltreRAZ_clicked();

    void on_buttonFiltreFiltrer_clicked();

    void on_buttonDetailMdp_clicked();

    void on_buttonDetailAccorder_clicked();


    void on_listDetailDroits_clicked(const QModelIndex &index);

    void on_buttonUtilisateurClore_clicked();

    void on_buttonVirIntCalculer_clicked();

    void on_buttonVirIntImprimer_clicked();

    void on_buttonUtilisateurHistorique_clicked();

    void on_buttonUtilisateurTransactions_clicked();

private:
    Ui::GUtils *ui;

    QSqlDatabase db;
    int idConnexion;

    //Dock gauche Promotions
    QSqlQueryModel *modelListProms;
    int idPromsModifier;

    //Tab Utilisateurs
    QSqlTableModel *modelUtilisateurs;
    int utilisateurSelected;

    //Vir Int
    QSqlQueryModel *modelVirInt;


};

#endif // GUTILS_H
